package sk.fei.vrml.main;

//import javax.media.opengl.GLCapabilities;
//import javax.media.opengl.GLAutoDrawableFactory;

import javax.swing.UIManager;
import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.UnsupportedLookAndFeelException;

import javax.media.opengl.GLCanvas;
import javax.media.opengl.GLCapabilities;

import sk.fei.vrml.gui.MainFrame;

public class Main {
	
	private static int windowsOpened;
	
	private static MainFrame window;
	public static void main(String args[]) {
		windowsOpened = 0;
		try {
			for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
		        if ("Nimbus".equals(info.getName())) {
		            UIManager.setLookAndFeel(info.getClassName());
		            break;
		        }
		    }
	        
	    } catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (UnsupportedLookAndFeelException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		window = new MainFrame();
	}
	
	public static synchronized int getNumOfWindows(){
		return windowsOpened;
	}
	
	
	public static MainFrame getWindow() {
		return window;
	}

	public static synchronized void addWindowOpened(){
		windowsOpened++;
	}
	
	public static synchronized void decWindowOpened(){
		windowsOpened--;
	}
}
